<template>
  <div>
    <van-nav-bar title="我的出租" left-arrow @click-left="backFn" />
    <van-list
      finished-text="没有更多了"
      @load="onLoad"
    >
    <CollectItem v-for='item in list' :key='item.id' :item='item'></CollectItem>
    </van-list>
  </div>
</template>

<script>
import { Myrent } from '@/api/favorites'
import CollectItem from '@/components/CollectItem.vue'
export default {
  name: 'CollectPage',
  components: { CollectItem },
  data () {
    return {
      list: []
    }
  },
  methods: {
    backFn () {
      this.$router.push('/My')
    },
    async onLoad () {
      const res = await Myrent()
      console.log(res)
      this.list = res.body
    }
  }
}
</script>

<style></style>
